package com.example.test

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.ViewModelProvider
import com.example.test.qtnet.*
import com.example.test.support.BaseNetworkApi
import com.example.test.support.NetworkRequestInfo
import com.example.test.support.PreferencesUtil

class MainActivity : AppCompatActivity() {
    var viewModel: TestViewModel? = null
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        BaseNetworkApi.init(NetworkRequestInfo(application))
        PreferencesUtil.init(application)


        viewModel = ViewModelProvider(this).get(TestViewModel::class.java)


        viewModel?.test()


        Request.onSystemMaintenance {

        }

        Request.onTokenInvalid {

        }

    }
}